package com.yanqu.road.server.cmd.union.cross;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.union.cross.CrossUnionProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.union.CrossUnionActivityLockRankMgr;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_UNION_ACTIVITY_LOCK_RANK, desc = "活动锁定排行")
public class CrossUnionActivityLockRankCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

        CrossUnionProto.CrossUnionActivityLockRankReq req = CrossUnionProto.CrossUnionActivityLockRankReq.parseFrom(packet.getBytes());
        int activityId = req.getActivityId();
        int activityEndTime = req.getActivityEndTime();
        int rankNum = req.getRankNum();
        MessageHelper.sendPacket(serverId, 0, YanQuMessageUtils.buildMessage(Protocol.S_UNION_ACTIVITY_LOCK_RANK_FROM_CROSS,
                CrossUnionActivityLockRankMgr.getLockRankList(serverId, activityId, activityEndTime, rankNum)));
    }

    @Override
    public void sendData() {

    }
}
